{% load app_tags %}

<nav class="sidebar collapse fixed-left" id="sidebar-nav">
    {% if settings.ENV != 'production' and settings.ENV != 'staging' and settings.SUPPORT_MENU_JSON %}
    <div class="sidebar-edit-wrapper">
        <button class="sidebar-edit" data-toggle="modal" data-target="#menu-editor-modal"><i class='fas fa-edit'></i>Edit menu</button>
    </div>
    {% endif %}

    {% if content_id != 'visualdl' %}
    <ul class="version-switcher">
        <li>
            <div class="version-label">Version:</div>
            <div class="version-row">{% version_links %}</div>
        </li>
    </ul>
    {% endif %}

    {% for chapter in side_nav_content.sections %}
    <ol class="content-links chapter">
        {% translation_assignment chapter.title as chapter_title %}
        {% translation_assignment chapter.link as chapter_link %}
        {% if chapter_title != None %}
        <li>
            {% if chapter_link != None and chapter_link != "" %}
                <h3><a href="{{ chapter_link|safe }}" {% if request.path in chapter_link %} class="active" {% endif %}
                {% if chapter_title == "API" or chapter_title == "Book" or chapter_title == "Models" or chapter_title == "Mobile" %} onclick="return showFullpageSpinnerForContentId('{{ chapter_title }}');" {% endif %}
                >{% translation chapter.title %}</a></h3>
            {% else %}
                <h3>{% translation chapter.title %}</h3>
            {% endif %}

            <ol class="section">
                {% for section in chapter.sections %}
                {% include "_content_links_section.html" %}
                {% endfor %}
            </ol>
        </li>
        {% endif %}
    </ol>
    {% endfor %}
</nav>
